//
// Created by Thinkpad on 2025/10/29.
//

#include <iostream>
using namespace std;

int main() {
    string str1 {"hello world"};
    cout << "For loop with array index notation : " << endl;
    cout << "str1(for loop): ";
    for (size_t i{};i < str1.size();i++) {
        cout << " " << str1.at(i);
    }
    cout << endl;

    cout << "using range based for loop: " << endl;
    for (char value : str1) {
        cout << value << " ";
    }
    cout << endl;

    str1[0] = 'b';
    str1.at(1) = 'A';


    return 0;
}